<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>从结果资源中返回值</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-fetch-object.html">pg_fetch_object</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-fetch-row.html">pg_fetch_row</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.pg-fetch-result" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_fetch_result</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">pg_fetch_result</span> &mdash; <span class="dc-title">从结果资源中返回值</span></p>

   </div>
   <div class="refsect1 unknown-unknown-unknown-unknown-unknown-seealst" id="refsect1-function.pg-fetch-result-unknown-unknown-unknown-unknown-unknown-seealst">
    <h3 class="title">说明</h3>
     <div class="methodsynopsis dc-description">
      <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>pg_fetch_result</strong></span>
       ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
      , <span class="methodparam"><span class="type">int</span> <code class="parameter">$row</code></span>
      , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$field</code></span>
      )</div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_fetch_result()</strong></span> 根据由 <span class="function"><a href="function.pg-query.html" class="function">pg_query()</a></span> 返回的 <em><code class="parameter">result</code></em> 资源返回相应的值。<em><code class="parameter">row</code></em> 为整型数。<em><code class="parameter">field</code></em> 为字段名（字符串）或字段索引（整数）。<em><code class="parameter">row</code></em> 和 <em><code class="parameter">field</code></em> 指明了查询结果中的哪个单元被返回。行编号从 0 开始。除了用字段名之外，还可以用不带引号的数字作为字段索引。字段索引从 0 开始。
    </p>
    <p class="para">
     PostgreSQL 有很多内置的类型，这里只直接支持基本类型。所有形式的
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>，<span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> 和 void 类型都被返回为
     <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> 值。所有形式的 float 和 real 类型都被返回为
     <span class="type"><a href="language.types.float.html" class="type float">float</a></span> 值。Boolean 类型被返回为 &quot;t&quot; 或者
     &quot;f&quot;。所有其它类型包括数组都被返回为字符串，该字符串的格式和默认的
     PostgreSQL 风格一样，可以在 <strong class="command">psql</strong> 程序中看到。
      
      
    </p>
   </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-fetch-object.html">pg_fetch_object</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-fetch-row.html">pg_fetch_row</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
